//
//  Mytools.h
//  7UGame
//
//  Created by 111 on 2017/2/14.
//  Copyright © 2017年 111. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Mytools : NSObject
//验证URL
+(BOOL) verifyURL:(NSString *)url;
//用于MD5加密的封装方法
+(NSString *)getMD5code:(NSString *)pswStr;
//获取当前时间戳
+(NSInteger)getCurrentTimestamp;
//字符串转日期
+(NSDate*)dateStrToDate:(NSString *)dateStr;
//日期转字符串
+(NSString *)dateToDateStr:(NSDate*)date;
//返回当天的日期
+(NSDate *)getCurrentDate;
//日期大小比较yyyy-MM-dd
+(int)compareOneDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay;
//url编码
+(NSString*)encodeString:(NSString*)unencodedString;
//时间戳转时间
+ (NSString *)timeStampTotime:(NSString *)timeString;
//转化为金钱格式
+(NSString *)numberToMoneyFormatter:(long)num;
//json转nsdata
+ (NSData *)dictionary2JsonData:(NSDictionary *)dict;
//nsdata转json
+ (NSDictionary *)jsonData2Dictionary:(NSData *)jsonData;
//取出字符串中的空格
+(NSString*)deleteSpaceInput:(NSString *)str;
//json格式字符串转字典
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
//字典转json格式字符串
+ (NSString*)dictionaryToJson:(NSDictionary *)dic;
//数组转字符串
+ (NSString*)ArrtionaryToJson:(NSMutableArray *)arr;
//判断是不是整数
+(BOOL)isPureInt:(NSString*)string;
//判断是不是浮点数
+(BOOL)isPureFloat:(NSString*)string;
//验证是不是合法的(邮箱)
+(BOOL)isEmail:(NSString *)email;
//验证是不是合法的(身份证号码)
+(BOOL)isIdCardNum:(NSString *)IdCardNumber;
//验证是不是银行卡
+(BOOL)validateBankCardNumber:(NSString *)bankCardNumber;
//是否是中文
+(BOOL)IsChinese:(NSString *)str ;
//是否是英文
+(BOOL)isEnglish:(NSString*)text;
//字符串中获取数字
+(NSString *)getNumberForString:(NSString *)str;
//去除utc时间
+ (NSString *)htcTimeToLocationStr:(NSString*)strM;
//返回一个月多少天
+(NSInteger)howManyDaysInThisYear:(NSInteger)year withMonth:(NSInteger)month;
//取主色调
+(UIColor*)mostColor:(UIImage*)image;
+(NSDate*)dateStrToDate:(NSString *)dateStr withFormat:(NSString*)format;
+(NSString*)returnDecimalNumStr:(NSString*)numStr;//解决json解析精度丢失的问题
//UIView转UIImage
+(UIImage*)viewBecomeImage:(UIView*)v;
//限制输入两位小数
+(NSString *)getMoneyFormat:(NSString*)money;
//scrollview转成图片
+(UIImage *)scrollViewBecomeImage:(UIScrollView *)scrollView;
//判断推送通知是否开启
+ (BOOL)isUserNotificationEnable;
//非法字符过滤判断
+(BOOL)hasIllegalCharacter:(NSString *)content;
//获取当前视图控制器
+(UIViewController*)currentViewController;
//小数点格式化：如果有两位小数不为0则保留两位小数，如果有一位小数不为0则保留一位小数，否则显示整数
+(NSString *)formatFloat:(float)f;
//NSUserDefaults清除全部（仅包含业务内容，第三方框架不删）
+(void)deleteAllUserDefaules;
//在输入的过程中判断是否是正确的身份证号码
+(NSString * )judgeIdNumInput:(NSString*)text;
//参数拼接
+(NSString *)dealWithParam:(NSDictionary *)param;
//是否是固定电话
+(BOOL)isTel:(NSString*)tel;
//从字符串中找出所有的url以数组返回
+(NSArray *)filterUrlWithString:(NSString*)str;
+(void)NeedResetNoViewWithTable:(UITableView*)tab andArr:(NSMutableArray*)arr;
@end
